home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 34.zip / BS1 part 34 / FredFish PD 315.adf / Surf / menudef.c < prev    next >
C/C++ Source or Header  |  1990-02-14  |  2KB  |  83 lines

  1. #include <exec/types.h>
  2. #include <exec/memory.h>
  3. #include <intuition/intuition.h>
  4. #include <graphics/gfxmacros.h>
  5. #ifdef MANX
  6. #include <functions.h>
  7. #endif
  8. #include "scrnio.h"
  9. #include "menudef.h"
  10.  
  11. #include "scrndef.h"
  12. #include "poly.h"
  13. #include "readilbm.h"
  14.  
  15. #define Selected(ax) ((ax).Flags & CHECKED)
  16.  
  17. #include "menu_color.c"
  18. #include "menu_scrn.c"
  19. #include "menu_image.c"
  20. #include "menu_files.c"
  21.  
  22. struct Menu menu[] ={
  23.     { &menu[1], /* next menu */
  24.     8, 0, /* x, y */
  25.     6*8, 10, /* w,h */
  26.     MENUENABLED,
  27.     (BYTE *)"File",
  28.     fileitems,
  29.     0,0,0,0
  30.     },
  31.     { &menu[2], /* next menu */
  32.     7*8, 0, /* x, y */
  33.     6*8, 10, /* w,h */
  34.     MENUENABLED,
  35.     (BYTE *)"Color",
  36.     coloritems,
  37.     0,0,0,0
  38.     },
  39.     { &menu[3], /* next menu */
  40.     14*8,0, /* x, y */
  41.     7*8, 10, /* w,h */
  42.     MENUENABLED,
  43.     (BYTE *)"Screen",
  44.     scrnitems,
  45.     0,0,0,0
  46.     },
  47.     { NULL, /* next menu */
  48.     22*8,0, /* x, y */
  49.     6*8, 10, /* w,h */
  50.     MENUENABLED,
  51.     (BYTE *)"Image",
  52.     imageitems,
  53.     0,0,0,0
  54.     }
  55. };
  56.  
  57.  
  58.  
  59. void MenuHandler(code)
  60. USHORT code;
  61. {
  62.     if( code == 0xffff ) { /* invalid menu pick */
  63.         return;
  64.     }
  65.  
  66.     switch( MENUNUM(code)) {
  67.         case 0: /* write ilbm */
  68.             MenuDoFile(ITEMNUM(code));
  69.             break;
  70.         case 1: /* set screen color */
  71.             MenuSetColMap();
  72.             break;
  73.         case 2: /* set screen type */
  74.             MenuSetScrn();
  75.             break;
  76.         case 3: /* set image stuff */
  77.             MenuSetImage();
  78.             break;
  79.         default:
  80.             break;
  81.     }
  82. }
  83.